home *** CD-ROM | disk | FTP | other *** search
- /*
- File: FWiX.h
-
- Contains: Definitions and interfaces for FireWire File Exchange driver
- family.
-
- Version: 1.0
-
- Written by: Jay Lloyd
-
- Copyright: © 1996-1998 by Apple Computer, Inc., all rights reserved.
-
- File Ownership:
-
- DRI: Jay Lloyd
-
- Other Contact:
-
- Technology: FireWire
-
- Writers:
-
- (jkl) Jay Lloyd
-
- Change History (most recent first):
-
- <16> 1/15/98 jkl Update for new interfaces.
- <FW15> 2/21/97 jkl Added packet types for handling sending data to non notify
- address space.
- <FW14> 2/19/97 jkl Added node info request and reply packet types.
- <FW13> 2/14/97 jkl Added flow control packet header constants.
- <FW12> 2/11/97 jkl Modified buffer sizes and counts.
- <FW11> 2/7/97 ES Added procedure prototype for GetNextFWXClientEvent.
- <FW10> 2/2/97 jkl Modified buffer sizes and values for performance improvements.
- <FW9> 1/27/97 jkl Added transfer status packet types.
- <FW8> 1/16/97 jkl Add user interface features for alpha candidate. Notification
- packet type.
- <FW7> 1/8/97 ES Added support for FWX nodes.
- <FW6> 11/13/96 jkl Added constants and declarations for multiple machine support
- and stop transfer.
- <FW5> 11/5/96 ES Changed kFWWriteSize to 3*kFWPayloadSize to fix flow control
- bug.
- <FW4> 10/31/96 jkl Added constants for folder copy.
- <FW3> 10/16/96 jkl Renamed constants for clarity. Changed
- buffer and payload size for performance tests.
- <FW2> 10/3/96 jkl Upped value of file read/write buffer size
- Had it set low for testing.
- <FW1> 10/2/96 jkl initial check-in, copied from avt family
-
- */
-
- #ifndef __FWIX__
- #define __FWIX__
-
- #ifndef __TYPES__
- #include <Types.h>
- #endif
- #ifndef __APPLEEVENTS__
- #include <AppleEvents.h>
- #endif
- #ifndef __NAMEREGISTRY__
- #include <NameRegistry.h>
- #endif
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- #if PRAGMA_IMPORT_SUPPORTED
- #pragma import on
- #endif
-
- #if PRAGMA_ALIGN_SUPPORTED
- #pragma options align=mac68k
- #endif
-
- ////////////////////////////////////////////////////////////////////////////////
- //
- // FireWire File Exchange driver family typedefs.
- //
-
- #define FWXDriverInterfacePascalName "\pFWXDriverInterface"
-
- #define kFWPacketSize 1024 // FireWire packet size
- #define kFWControlBufferSize 1024 // Size of FireWire control buffer
- #define kFWDataBufferSize (32*1024) // Size of FireWire data buffer
-
- typedef struct OpaqueFWXClientID* FWXClientID;
- typedef struct OpaqueFWXDriverID* FWXDriverID;
- typedef struct OpaqueFWXNodeID* FWXNodeID;
-
- enum { // packet header types
- kStartFile = 1,
- kEndFile = 2,
- kStartDataFork = 3,
- kEndDataFork = 4,
- kStartResFork = 5,
- kEndResFork = 6,
- kFileInfo = 7,
- kForkData = 8,
- kStartFolder = 9,
- kEndFolder = 10,
- kFolderInfo = 11,
- kNodeInfoRequest = 12,
- kNodeInfoReply = 13,
- kQuitNotify = 14,
- kPreflightCopy = 15,
- kPreflightReply = 16,
- kReceiveReply = 17,
- kFCDataRequest = 18,
- kFCControlRequest = 19,
- kFCDataReply = 20,
- kFCControlReply = 21,
- kTransferStopped = 22,
- kDataDone = 23,
- kAddressInfoRequest = 24,
- kAddressInfoReply = 25
- };
-
- enum
- {
- kInvalidFWXClientID = 0,
- kInvalidFWXDriverID = 0,
- kInvalidFWXNodeID = 0
- };
-
- enum
- {
- kServiceCategoryFWiX = 'FWiX'
- };
-
- enum
- {
- // Apple event class for FireWire File Exchange driver family.
- kAEFWXEventClass = 'FWiX',
-
- // Apple events sent by FireWire File Exchange driver family.
- kAEFWXDeviceAdded = 'ADDD',
- kAEFWXDeviceRemoved = 'RMVD',
-
- // Parameters used by FireWire File Exchange driver family Apple events.
- kAEFWXNodeIDKey = 'NDID',
- kAEFWXNodeIDType = typeLongInteger //zzz should we have our own???
- };
-
- struct FWXInterfaceParamsStruct
- {
- UInt32 interfaceSelector;
- Ptr pDriverSpecificData;
- Ptr pNodeSpecificData;
- };
- typedef struct FWXInterfaceParamsStruct
- FWXInterfaceParams,
- *FWXInterfaceParamsPtr;
-
- typedef OSStatus
- (FWXInterfaceProc) (
- FWXInterfaceParamsPtr pInterfaceParams);
- typedef FWXInterfaceProc *FWXInterfaceProcPtr;
-
- enum
- {
- kFWXInitialize = 1,
- kFWXTerminate = 2,
- kFWXWrite = 3,
- kFWXRead = 4,
- kFWXKillIO = 5,
- kFWXOpenNode = 6,
- kFWXCloseNode = 7
- };
-
- struct FWXInitializeParamsStruct
- {
- FWXInterfaceParams fwxInterfaceParams;
- RegEntryID *pDriverRegEntry;
- FWXDriverID fwxDriverID;
- };
- typedef struct FWXInitializeParamsStruct
- FWXInitializeParams,
- *FWXInitializeParamsPtr;
-
- struct FWXTerminateParamsStruct
- {
- FWXInterfaceParams fwxInterfaceParams;
- RegEntryID *pDriverRegEntry;
- };
- typedef struct FWXTerminateParamsStruct
- FWXTerminateParams,
- *FWXTerminateParamsPtr;
-
- struct FWXAsynchParamsStruct
- {
- FWXInterfaceParams fwxInterfaceParams;
- IOParamPtr pIOPB;
- };
- typedef struct FWXAsynchParamsStruct
- FWXAsynchParams,
- *FWXAsynchParamsPtr;
-
- struct FWXOpenNodeParamsStruct
- {
- FWXInterfaceParams fwxInterfaceParams;
- UInt32 fwxNodeRegistrationReference;
- };
- typedef struct FWXOpenNodeParamsStruct
- FWXOpenNodeParams,
- *FWXOpenNodeParamsPtr;
-
- struct FWXCloseNodeParamsStruct
- {
- FWXInterfaceParams fwxInterfaceParams;
- UInt32 fwxNodeRegistrationReference;
- };
- typedef struct FWXCloseNodeParamsStruct
- FWXCloseNodeParams,
- *FWXCloseNodeParamsPtr;
-
-
- ////////////////////////////////////////////////////////////////////////////////
- //
- // FireWire File Exchange driver family services.
- //
-
- OSStatus RegisterFWXClientApplication (
- FWXClientID *pFWXClientID,
- UInt32 clientContextData);
-
- OSStatus UnregisterFWXClientApplication (
- FWXClientID fwxClientID);
-
- OSStatus GetFWXDriverList (
- FWXDriverID *pFWXDriverIDList,
- UInt32 fwxDriverIDListSize,
- UInt32 *pNumFWXDrivers);
-
- OSStatus CallFWXDriver (
- IOParamPtr pIOPB);
-
- OSStatus OpenFWXDriver (
- FWXDriverID fwxDriverID);
-
- OSStatus CloseFWXDriver (
- FWXDriverID fwxDriverID);
-
- OSStatus GetFWXNodeList (
- FWXNodeID *pFWXNodeIDList,
- UInt32 fwxNodeIDListSize,
- UInt32 *pNumFWXNodes);
-
- OSStatus CallFWXNode (
- IOParamPtr pIOPB);
-
- OSStatus OpenFWXNode (
- FWXNodeID fwxNodeID);
-
- OSStatus CloseFWXNode (
- FWXNodeID fwxNodeID);
-
- OSStatus RegisterFWXNode (
- FWXDriverID fwxDriverID,
- UInt32 fwxNodeRegistrationReference);
-
- OSStatus UnregisterFWXNode (
- FWXDriverID fwxDriverID,
- UInt32 fwxNodeRegistrationReference);
-
- OSStatus GetNextFWXClientEvent (
- FWXClientID fwxClientID);
-
-
- #if PRAGMA_ALIGN_SUPPORTED
- #pragma options align=reset
- #endif
-
- #if PRAGMA_IMPORT_SUPPORTED
- #pragma import off
- #endif
-
- #ifdef __cplusplus
- }
- #endif
-
- #endif /* FWIX */
-